# l1 = [1,2,3,23,344,654,7,8,1]
# # l2 = l1[-2::2]
# # print(l2)
# l2 = []
# for i in l1:
#     if i in [1,3,23,8]:
#         l2.append(i)
# print(l2)

#冒泡排序
# l1 = [1,2,3,23,344,654,7,8,1]
# n =len(l1)
# for i in range(n):
#     for j in range(0,n-i-1):
#         if l1[j]>l1[j+1]:
#             l1[j],l1[j+1]=l1[j+1],l1[j]
# print(l1)

# l2 = "qwrfsdgfdjhgmgndfshg"
# # print(l2.find("s"))
# print(l2.split("s"))


# l3 = ["haha", 1, 2, "嘿嘿"]
#
# if "hahah" in l3:  # 这里应该是检查当前元素 i 中是否包含 "haha"
#     print(True)
# else:
#     print(False)
#
# l4 =["嘿哈",1,4,1,2,8]
# l5=list(reversed(l4))
# print(l5)

# dic = {"1":"1.1"}
# dic["2"]="2.2"
# print(dic["1"])
# print(dic.get("2", "空"))
# print(dic.keys())
# print(dic.values())
# print(dic.items())

# for i in dic.items():
#     print(i)
#
# for i ,j in dic.items():
#     print(i,j)


# class Pre:
#     def __init__(self, name, age):
#         self.name = name
#         self.age = age
#
#     def preon(self):
#         print(f"我叫：{self.name}，今年：{self.age}岁了。")
#
#
# pp = Pre("张三", "18")
# pp.preon()

# import json
# dict1= '{"d1":"1","d2":{"d22":"22","d23":{"d33":"33","d34":"34"}}}'
#
# dit2 = json.loads(dict1)
# print(dit2)

import json
from jsonpath import jsonpath

json_str = {"d1":"1","d2":{"d22":"22","d23":{"d33":"33","d34":"34"}}}
d2 = jsonpath(json_str,"$..d22")
# dict1 = json.dumps(json_str)
print(d2)